<template>
	<view class="im-item-box">
		<view class="im-time" v-if="itemJob.datetime">
			{{itemJob.datetime}}
		</view>
		<view class="job-box" @click="handleLink">
			<view class="job-top">
				<view class="job-info">
					<view class="job-name substring">{{itemJob.message.jobname}}</view>
					<view class="job-salary substring">{{itemJob.message.wage_text}}</view>
				</view>
				<view class="job-demand">
					<view class="demand-item">{{itemJob.message.education_text}}</view>
					<view class="demand-item">{{itemJob.message.experience_text}}</view>
					<view class="demand-item">{{itemJob.message.district_text}}</view>
				</view>
			</view>
			<view class="job-bottom">
				<view class="company-time"><text style="margin-right: 15rpx;">{{itemJob.addtime | interviewTimeFilter}}</text> 由{{itemJob.self_side==1?'你':'对方'}}发起的沟通</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		parseTime,
		formatTime
	} from '@/utils/index.js'
	import {mapState} from 'vuex'
	export default {
		props: ['itemJob'],
		filters: {
			timeFilter(timestamp) {
				return formatTime(timestamp, '{y}-{m}-{d}', true)
			},
			interviewTimeFilter(timestamp) {
				return parseTime(timestamp, '{y}-{m}-{d} {h}:{i}')
			}
		},
		computed: {
		},
		methods: {
			handleLink() {
				// let params = {
				// 	id: this.itemJob.message.jobid
				// }
				uni.navigateTo({
					url:'/commonViews/JobShow?id=' + this.itemJob.message.jobid
				});
			}
		}
	}
</script>
<style lang="scss" scoped>
	//发送职位开始 / 企业邀请投递简历开始
	.delivery-title {
		width: 690px;
		color: #333333;
		font-size: 36rpx;
		height: 98rpx;
		line-height: 98rpx;
		font-weight: bold;
		border-bottom: 2rpx solid #e8e8e8;
		margin: 0 auto;
		background: #fff;
		padding: 0 30rpx;
	}

	.job-box {
		// width: 690rpx;
		margin: 0 36rpx;
		max-height: 550rpx;
		background: #FFFFFF;
		border-radius: 10rpx;
		font-size: 28rpx;
		padding: 0 30rpx;

		.job-top {
			padding: 30rpx 0 30rpx;
			border-bottom: 2rpx solid #ededed;

			.job-info {
				display: flex;
				margin-bottom: 20rpx;
				align-items: center;
				.job-name {
					flex: 2.5;
					color: #2E2E2E;
					font-size: 34rpx;
					font-weight: bold;
					margin-right: 60rpx;
				}

				.job-salary {
					flex: 1;
					// color: $textActiveColor;
					font-size: 28rpx;
					text-align: right;
				}
			}

			.job-demand {
				display: flex;
				flex-wrap: wrap;

				.demand-item {
					color: #666666;
					font-size: 24rpx;
					margin-right: 20rpx;
					background: #F8F8F8;
					padding: 10rpx 20rpx;
					border-radius: 10rpx;
					&:last-child {
						margin-right: 0;
					}
				}
			}
		}

		.job-bottom {
			padding: 24rpx 0 ;

			.company-info-box {
				display: flex;  
				margin-bottom: 26rpx;

				.company-img {
					width: 64rpx;
					height: 64rpx;
					margin-right: 34rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.company-info {
					width: calc(690rpx - 64rpx - 34rpx - 64rpx);

					.company-name {
						color: #333333;
						font-size: 26rpx;
						font-weight: bold;
					}

					.company-text {
						color: #999999;
						font-size: 24rpx;
					}
				}
			}

			.company-time {
				color: #999999;
				font-size: 26rpx;
			}

			.delivery-btn {
				width: 500rpx;
				height: 70rpx;
				background: #1787FB;
				border-radius: 34rpx;
				text-align: center;
				line-height: 70rpx;
				color: #fff;
				margin: 44rpx auto 0;

				&.delivery-btn-ac {
					background: #CECECE;
				}
			}
		}
	}

	//发送职位结束 / 企业邀请投递简历结束
</style>
